
#pragma once

#include <cstdint>
#include <string>
#include <cstring>
#include <unistd.h>
#include <errno.h>

struct FileOperation
{

	int m_file_handle;
	std::string m_file_name;
	int m_file_size;
	uint32_t m_index{0};
	uint8_t  m_buffer[1480];
	int      m_packet_index{0};
};

bool InitFileOperation(FileOperation & file_opertion, int mode);

void FreeFileOperation(FileOperation & file_operation);

int GetFileContent(FileOperation & file_opertion);

void SaveFileContent(FileOperation & file_operation, uint8_t * data, int length);

